﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Text;

/// <summary>
/// Summary description for BaseBAL
/// </summary>
public class BaseBAL
{
	public BaseBAL()
	{
		//
		// TODO: Add constructor logic here
		//
	}
	public string ToJson()
	{
		return Newtonsoft.Json.JsonConvert.SerializeObject(this);
	}
    public string ToJsonList<T>(IList<T> list)
    {
        StringBuilder result = new StringBuilder();
        result.Append("[");
        for (int i = 0; i < list.Count; i++)
        {
            result.Append(Newtonsoft.Json.JsonConvert.SerializeObject(list[i]));
            if (i < list.Count - 1)
            {
                result.Append(",");
            }
        }
        result.Append("]");
        return result.ToString();
    }
}